<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class ForumPost extends Model
{
    use SoftDeletes;
    protected $guarded = [];
    protected $dates = ['deleted_at'];

    public function sort()
    {
        return $this->belongsTo('App\ForumSort', 'sort_id');
    }

    public function user()
    {
        return $this->belongsTo('App\User', 'user_id');
    }

    public function comment()
    {
        return $this->hasMany('App\ForumComment', 'post_id');
    }

    public function zan()
    {
        return $this->hasOne('App\ForumZan', 'post_id');
    }
}
